'use strict';

module.exports = ({ POST, GET, UPLOAD }) => ({
  // 发送小程序消息
  MinaTemplateSend: (...args) =>
    POST(
      'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send',
      ...args
    ),

  // code获取session
  MinaCode2Session: (...args) =>
    GET('https://api.weixin.qq.com/sns/jscode2session', ...args),

  // 创建临时二维码
  CreateTmpQRCode: (...args) =>
    POST('https://api.weixin.qq.com/cgi-bin/qrcode/create', ...args),

  // 获取 token
  GetToken: (...args) =>
    GET('https://api.weixin.qq.com/cgi-bin/token', ...args),

  // 创建永久二维码
  CreateLimitQRCode: (...args) =>
    POST('https://api.weixin.qq.com/cgi-bin/qrcode/create', ...args),

  // 发送小程序
  SendMinaMsg: (...args) =>
    POST('https://api.weixin.qq.com/cgi-bin/message/custom/send', ...args),

  // 设置菜单
  CreateMenu: (...args) =>
    POST('https://api.weixin.qq.com/cgi-bin/menu/create', ...args),

  // 查询菜单
  GetMenu: (...args) =>
    GET('https://api.weixin.qq.com/cgi-bin/menu/get', ...args),

  // 获取用户基本信息（包括UnionID机制）
  GertUserInfo: (...args) =>
    GET('https://api.weixin.qq.com/cgi-bin/user/info', ...args),

  // 推送模板消息
  SendWechatTplMsg: (...args) =>
    POST('https://api.weixin.qq.com/cgi-bin/message/template/send', ...args),

  // 获取用户列表
  GetOpenidList: (...args) =>
    GET('https://api.weixin.qq.com/cgi-bin/user/get', ...args),

  // 获取用户信息
  GetUserInfo: (...args) =>
    GET('https://api.weixin.qq.com/cgi-bin/user/info', ...args),

  // 批量获取用户基本信息
  BatchgetUserInfo: (...args) =>
    POST('https://api.weixin.qq.com/cgi-bin/user/info/batchget', ...args),

  // 通过code换取网页授权access_token
  SnsOauth2: (...args) =>
    GET('https://api.weixin.qq.com/sns/oauth2/access_token', ...args),

  // 通过access_token换取网页授权jsapi_ticket
  GetSignTicket: (...args) =>
    GET('https://api.weixin.qq.com/cgi-bin/ticket/getticket', ...args),

  // 通过access_token换取网页授权用户信息
  SnsUserinfo: (...args) =>
    GET('https://api.weixin.qq.com/sns/userinfo', ...args),

  // 上传素材
  AddMaterial: (...args) =>
    UPLOAD('https://api.weixin.qq.com/cgi-bin/material/add_material', ...args),

  // 服务商城
  ServiceMarket: (...args) =>
    POST('https://api.weixin.qq.com/wxa/servicemarket', ...args),

  // 行驶证识别
  VehicleLicense: (...args) =>
    POST('https://api.weixin.qq.com/cv/ocr/driving', ...args),

  // 身份证识别
  IdCardLicense: (...args) =>
    UPLOAD('https://api.weixin.qq.com/cv/ocr/idcard', ...args),

  // 通用印刷体识别
  OcrOfPrintedText: (...args) =>
    UPLOAD('https://api.weixin.qq.com/cv/ocr/comm', ...args),

  // 小程序的图片智能裁剪能力
  AiCrop: (...args) => POST('https://api.weixin.qq.com/cv/img/aicrop', ...args),

  // 批量为用户打标签
  BatchTagging: (...args) =>
    POST(
      'https://api.weixin.qq.com/cgi-bin/tags/members/batchtagging',
      ...args
    ),

  // 批量为用户取消标签
  BatchUnTagging: (...args) =>
    POST(
      'https://api.weixin.qq.com/cgi-bin/tags/members/batchuntagging',
      ...args
    ),

  // 订阅发送
  SubscribeSend: (...args) =>
    POST('https://api.weixin.qq.com/cgi-bin/message/subscribe/send', ...args),

  // 公众号模板消息
  PublicNotice: (...args) =>
    POST('https://api.weixin.qq.com/cgi-bin/message/template/send', ...args),

  // 是否关注
  isFollowPublicWechat: (...args) =>
    GET('https://api.weixin.qq.com/cgi-bin/user/info', ...args)
});
